package harima.agameditor.mapeditor.ui;

import harima.agameditor.common.ui.BaseEditorPanel;
import harima.agameditor.common.ui.GenericTreeNode;
import harima.agameditor.mapeditor.control.MapEditorController;
import harima.agameditor.resources.PanelIds;

import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeModel;

public class MapBrowser_panel extends BaseEditorPanel<MapEditorController> {

	JTree mapsTree;

	GenericTreeNode rootNode;
	DefaultTreeModel treeModel;

	public MapBrowser_panel() {
		rootNode = new GenericTreeNode("My TestNode", "");
		treeModel = new DefaultTreeModel(rootNode);
		mapsTree = new JTree(treeModel);
		add(mapsTree);
		panelID = PanelIds.MAP_BROWSER_PANEL;

	}

	public void browseMaps() {
		treeModel.setRoot(controller.getServices().getMapHierachy());
		treeModel.reload();
	}
}
